<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../js/html5shiv.js"></script>
    <script type="text/javascript" src="../js/respond.min.js"></script>
    <![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../css/H-ui.css" />
    <link rel="stylesheet" type="text/css" href="../css/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../css/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <title></title>

</head>
<body>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-user-add">
        <input type="hidden" id="userIdChild" user-id-child= "" data-iftrue=""/>

            <table class="table table-border table-bordered table-hover table-bg">
                <thead>
                    <tr class="text-c">
                        <th width="150">用户姓名</th>
                        <th width="150">登录账号</th>
                    </tr>
                </thead>
                <tbody class="tableCon">

                </tbody>
            </table>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="/js/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/js/H-ui.js"></script>
<script type="text/javascript" src="/js/H-ui.min.js"></script>
<script type="text/javascript" src="/js/postJson.js"></script>
<script type="text/javascript" src="/js/root.js"></script>
<script type="text/javascript" src="/js/jquery.validation/jquery.validate.js"></script>
<script type="text/javascript" src="/js/jquery.validation/validate-methods.js"></script>
<script type="text/javascript" src="/js/jquery.validation/messages_zh.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">
/*页面初始化*/
function updataEdie(){
    //获取父窗口roleId
    var roleId =  Number(parent.$("#roleId").attr("data-roleId"))
    var dataCollect="id="+roleId;
    dataCollect= decodeURIComponent(dataCollect,true);//防止中文乱码
    var jsondata=strJSON.formToJson(dataCollect);//转化为json
    var url = "/sysRole/getOaStaffsByRoleId";
    $.ajax({
        url:url,
        contentType:"application/json",
        data:jsondata,
        type:"post",
        async:false,
        dataType:'json',
        success:function(msg){
            // console.log(JSON.stringify(msg))
            if(msg.success) {
                var htmlString = '';
                $(".tableCon").empty();
                $.each(msg.data,function(i,n){
                    htmlString += '<tr class="text-c" roleid="'+ n.id+'">'
                    htmlString += '<td>'+ n.name+'</td>'
                    htmlString += '<td>'+ n.account+'</td>'
                    htmlString += '</tr>'
                })
                $(".tableCon").append(htmlString)
            }else {
                var error = msg.errorMessage;
                parent.layer.msg(error,{icon:2,time:3000});
            }
        },
        error:function(XMLHttpRequest,textStatus,errorThrown){
            var XmlStatus = XMLHttpRequest.status
//                         console.log(XMLHttpRequest.status)
            if(XmlStatus==401){
                alert(XmlError.error401)
                parent.window.location.href = "../login.html"
            }
            if(XmlStatus==403){
                alert(XmlError.error403)
            }
        }
    });
}
updataEdie()
</script>
</body>
</html>